import Vue from 'vue';
import VueRouter from 'vue-router';
import home from '../views/home';
import about from '../views/about';

Vue.use(VueRouter); //要把vuerouter在vue里面实例化一下

let router = new VueRouter({
    routes: [
        {
            // 默认跳转的地址
            path: '/',
            // redirect:"当路径为/时，默认跳转的路径"
            redirect: '/home'
        },
        {
            // path:"路径地址"
            path: '/home',
            // component:需要跳转的组件
            component: home
        },
        {
            path: '/about',
            component: about
        },
    ],
});
export default router;
